SUBROUTINE CHECKBOX2
*Display a simple form with one group of checkboxes,*each box with its own unique name*Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Get the URL of the Reality item server
STYLESHEET = ""
CALL RW_GET_PARAM("__isurl", STYLESHEET)* Specify the location of the stylesheet
STYLESHEET = STYLESHEET : "/REALWEB-ITEMS/jstyles.css"
* Start the HTML page* Display the text 'Form with Checkboxes' in the browser's title bar* Use the styles stylesheetCALL RW_START_HTML_PAGE("Form with Checkboxes", "", STYLESHEET, "", "")*Start the HTML form, specifying that the subroutine RESPONSE2 should be run when the submit button is clickedCALL RW_START_HTML_FORM("RESPONSE2","FORM6","")CALL RW_PUT("Please enter your surname and membership number in the boxes")CALL RW_NEWLINE*Set up LEG_CLASS to specify format of legend
LEG_CLASS="legend"
LEG_CLASS<2>="right"
*Start the group of fieldsCALL RW_START_FIELDSET("")
BUF="Member Details"
CALL RWS_LEGEND(BUF,LEG_CLASS)CALL RW_PUT(BUF)CALL RW_PUT("Surname ")CALL RW_EDIT_BOX("NAME",30,"")CALL RW_NEWLINECALL RW_PUT("Membership Number:")CALL RW_EDIT_BOX("NAME",9,"")CALL RW_NEWLINES(2)*Complete the groupCALL RW_END_FIELDSETCALL RW_NEWLINES(2)CALL RW_PUT("Now check which options you require")CALL RW_NEWLINE*Create the checkboxesCALL RW_CHECKBOX("edchoice","Yes",0,0,"")CALL RW_PUT("Order the Editor's Choice")CALL RW_NEWLINECALL RW_CHECKBOX("events","Yes",0,0,"")CALL RW_PUT("Request Details of Forthcoming Events")CALL RW_NEWLINECALL RW_CHECKBOX("balance","Yes",0,0,"")CALL RW_PUT("View the Balance of My Account")CALL RW_NEWLINECALL RW_CHECKBOX("payment","Yes",0,0,"")CALL RW_PUT("Pay for Recent Orders")CALL RW_NEWLINES(2)*Create the submit buttonCALL RW_SUBMIT_BUTTON("Submit Details","")*Complete the formCALL RW_END_FORM* Complete the pageCALL RW_END_PAGE
RETURN
SUBROUTINE RESPONSE2
*Display message acknowledging requested options to user submitting Form 6* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Start the HTML page* Display the text 'Response to Form' in the browser's title barCALL RW_START_HTML_PAGE("Response to Form", "", "", "", "")CALL RW_PUT("Thankyou for your selections")CALL RW_NEWLINE*Get the value of "edchoice" from Form 6CALL RW_GET_PARAM("edchoice",EDCHOICE)*Get the value of "events" from Form 6CALL RW_GET_PARAM("events",EVENTS)*Get the value of "balance" from Form 6CALL RW_GET_PARAM("balance",BALANCE)*Get the value of "payment" from Form 6CALL RW_GET_PARAM("payment",PAYMENT)
IF EDCHOICE = "Yes" THEN
CALL RW_NEWLINECALL RW_PUT("The Editor's Choice will be dispatched immediately")
END
IF EVENTS = "Yes" THEN
CALL RW_NEWLINECALL RW_PUT("Details of forthcoming events will be sent to you immediately")
END
IF BALANCE = "Yes" THEN
CALL RW_NEWLINECALL RW_PUT("You are being transferred to the Accounts System. Your balance will be displayed shortly.")
END
IF PAYMENT = "Yes" THEN
CALL RW_NEWLINECALL RW_PUT("You are being transferred to the Accounts System for entry of credit card details")
END
* Complete the pageCALL RW_END_PAGE
RETURN
Form Page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Form with Checkboxes</TITLE><STYLE type="text/css"><!-- @import url(/servlet/realityis/test/REALWEB-ITEMS/jstyles.css); --></STYLE></HEAD><BODY><FORM ACTION="RESPONSE2" NAME="FORM6" METHOD="POST">
Please enter your surname and membership number in the boxes
<BR>
<FIELDSET ><LEGEND CLASS="legend" ALIGN="right">Member Details</LEGEND>
Surname
<INPUT NAME="NAME" SIZE="30" TYPE="TEXT"><BR>
Membership Number:
<INPUT NAME="NAME" SIZE="9" TYPE="TEXT"><BR><BR></FIELDSET><BR><BR>
Now check which options you require
<BR><INPUT TYPE=CHECKBOX NAME="edchoice" VALUE="Yes">
Order the Editor's Choice
<BR><INPUT TYPE=CHECKBOX NAME="events" VALUE="Yes">
Request Details of Forthcoming Events
<BR><INPUT TYPE=CHECKBOX NAME="balance" VALUE="Yes">
View the Balance of My Account
<BR><INPUT TYPE=CHECKBOX NAME="payment" VALUE="Yes">
Pay for Recent Orders
<BR><BR><INPUT TYPE="submit" VALUE="Submit Details"></FORM></BODY></HTML>
Response Page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Response to Form</TITLE></HEAD><BODY>
Thankyou for your selections
<BR><BR>
The Editor's Choice will be dispatched immediately
<BR>
You are being transferred to the Accounts System. Your balance will be displayed shortly.
</BODY></HTML>